package util.enumhelper;

import util.enumeration.IsHalal;
import util.enumeration.Language;

/**
 *
 * @author Amelia
 */

public class LocalizedHalalType {

    // alphabetical order
    public static String getLocalizedHalalTypeAsString(IsHalal isHalal, String locale) {
        String localizedHalalType = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedHalalType = getHalalType_EN_US(isHalal);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedHalalType = getHalalType_EN_SG(isHalal);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedHalalType = getHalalType_MS_MY(isHalal);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedHalalType = getHalalType_ZH_CN(isHalal);
        }
        // other language...
        else {
            localizedHalalType = getHalalType_EN_US(isHalal);
        }
        
        return localizedHalalType;
    }
    
    // simplified chinese (zh_CN)
    private static String getHalalType_ZH_CN(IsHalal isHalal) {
        String localizedHalalType = "";
        
        switch (isHalal) {
            case YES: localizedHalalType = "是" ; break;
            case NO: localizedHalalType = "不是"; break;
        }
        return localizedHalalType;
    }
    
    // default (en_US)
    private static String getHalalType_EN_US(IsHalal isHalal) {
        String localizedHalalType = "";
        
        switch (isHalal) {
            case YES: localizedHalalType = "Yes" ; break;
            case NO: localizedHalalType = "No"; break;
        }
        return localizedHalalType;
    }
    
    // singapore english (en_SG)
    private static String getHalalType_EN_SG(IsHalal isHalal) {
        String localizedHalalType = "";
        
        switch (isHalal) {
            case YES: localizedHalalType = "Yes" ; break;
            case NO: localizedHalalType = "No"; break;
        }
        return localizedHalalType;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getHalalType_MS_MY(IsHalal isHalal) {
        String localizedHalalType = "";
        
        switch (isHalal) {
            case YES: localizedHalalType = "Ya" ; break;
            case NO: localizedHalalType = "Tiada"; break;
        }
        return localizedHalalType;
    }
    
    // new halatype for localized language template (copy and paste to use)
    //private static String getHalalType_XX_XX(IsHalal isHalal) {
    //    String localizedHalalType = "";
        
    //  switch (isHalal) {
    //    case YES: localizedHalalType = "ya" ; break;
    //  case NO: localizedHalalType = "Wanita"; break;
    //    }
    //    return localizedHalalType;
    //}
}
